<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/style.css" />
	<link rel="shortcut icon" href="<?php echo Yii::app()->request->baseUrl; ?>/favicon.ico" type="image/x-icon" />
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
	
	<?php Yii::app()->clientScript->registerScriptFile('http://code.jquery.com/jquery-migrate-1.2.1.js'); ?>	
	
	<!--<style>
		html, body {
		height: 100%;
		margin: 0;
		padding: 0;
		}
		.page-wrapper {
			min-height: 100%;
			margin-bottom: -50px;
		}
		* html .page-wrapper {
			height: 100%;
		}
		.page-buffer {
			height: 50px;
		}
	</style>-->
</head>

<body>

	<!--<div class="page-wrapper">
	
		<div class="page-buffer">-->
		
<div class="container" id="page">

	<div id="header"><div id="logo"><?php echo CHtml::encode(Yii::app()->name); ?><sup style="font-size:10px;color:#ccc;"><i>&nbsp;<?php echo Yii::app()->params['version']; ?></i></sup></div></div>
	<!-- header -->

				<div id="mainmenu">
					<?php $this->widget('bootstrap.widgets.TbMenu',array(
						'type'=>'tabs',
						'stacked'=>false, 
						'items'=>array(
							array('label'=>'Главная', 'url'=>array('/post/index'), 'visible'=>!Yii::app()->user->isGuest),
							array('label'=>'|', 'url'=>'#', 'visible'=>!Yii::app()->user->isGuest),
							array('label'=>'Таблица', 'url'=>array('/notes/admin'), 'visible'=>Yii::app()->user->name == 'admin'),
							array('label'=>'|', 'url'=>'#', 'visible'=>Yii::app()->user->name == 'admin'),
							array('label'=>'Баннеры', 'url'=>'#', 'items'=>array(
								array('label'=>'Материалы', 'url'=>array('/src/admin')),
								array('label'=>'Слова', 'url'=>array('/words/admin')),
							), 'visible'=>Yii::app()->user->name == 'admin'),
							array('label'=>'|', 'url'=>'#', 'visible'=>Yii::app()->user->name == 'admin'),
							array('label'=>'Управление', 'url'=>'#', 'items'=>array(
								array('label'=>'Права', 'url'=>array('/rights')),
								array('url'=>array('/user/admin'), 'label'=>'Пользователи'),
							), 'visible'=>Yii::app()->user->name == 'admin'),										
							array('label'=>'|', 'url'=>'#', 'visible'=>Yii::app()->user->checkAccess(Rights::module()->superuserName)),
							array('label'=>'Сообщения', 'url'=>'#', 'items'=>array(
								array('label'=>'Создать новое сообщение', 'url'=>array('/post/create')),
								array('label'=>'Управление сообщениями', 'url'=>array('/post/admin')),		
							    array('label'=>Yii::t('blog', 'Подтвердить комментарии (:commentCount)',array(':commentCount'=>Comment::model()->pendingCommentCount)),'url'=>array('/comment/index')),								
							), 'visible'=>Yii::app()->user->checkAccess(Rights::module()->superuserName)),							
							array('label'=>'|', 'url'=>'#', 'visible'=>Yii::app()->user->name == 'admin'),
							/*array('label'=>'Мониторинг', 'url'=>'#', 'items'=>array(
								array('label'=>'Отдел рекламы', 'url'=>array('/promo/admin')),
								array('label'=>'Редакция', 'url'=>array('/editors/admin')),
								array('label'=>'Верстка', 'url'=>array('/markups/admin')),
							), 'visible'=>!Yii::app()->user->isGuest),*/
							array('label'=>'Отдел рекламы', 'url'=>array('/promo/admin'), 'visible'=>!Yii::app()->user->isGuest),
							array('label'=>'|', 'url'=>'#', 'visible'=>!Yii::app()->user->isGuest),	
							array('label'=>'Редакция', 'url'=>array('/editors/admin'), 'visible'=>!Yii::app()->user->isGuest),
							array('label'=>'|', 'url'=>'#', 'visible'=>!Yii::app()->user->isGuest),	
							array('label'=>'Верстка', 'url'=>array('/markups/admin'), 'visible'=>!Yii::app()->user->isGuest),
							array('label'=>'|', 'url'=>'#', 'visible'=>!Yii::app()->user->isGuest),		
							array('label'=>'Мониторинг редакторов', 'url'=>array('/moneditors/admin'), 'visible'=>Yii::app()->user->checkAccess('Editor')),
							array('label'=>'|', 'url'=>'#', 'visible'=>Yii::app()->user->checkAccess('Editor')),								
							array('label'=>'История', 'url'=>array('/history/admin'), 'visible'=>Yii::app()->user->name == 'admin'),							
							array('label'=>'|', 'url'=>'#', 'visible'=>Yii::app()->user->name == 'admin'),	
							array('label'=>'Файлы','url'=>array('/site/fileupload'),'visible'=>Yii::app()->user->name=='admin' || Yii::app()->user->name=='popova' || Yii::app()->user->name=='denisov'),
							array('label'=>'|', 'url'=>'#', 'visible'=>Yii::app()->user->name=='admin' || Yii::app()->user->name=='popova' || Yii::app()->user->name=='denisov'),
							array('label'=>'Вход', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
							array('label'=>'Выход ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),
						),
					)); ?>
				</div><!-- mainmenu -->
			
				<?php $this->widget('application.extensions.flash.Flash', array('keys'=>array('success','error'),'htmlOptions'=>array('class'=>'flash'))); ?><!-- flashes -->

				<?php $this->widget('zii.widgets.CBreadcrumbs', array('links'=>$this->breadcrumbs)); ?><!-- breadcrumbs -->

				<?php echo $content; ?>
				
				<div class="clear"></div>
			
			<!--</div> -->

		<!--</div>
	
	</div>-->
	<?php /*
		if (Yii::app()->user->isGuest == "0") {
	
			$credentials = Yii::app()->db->createCommand()
			->select('glogin, gpassword')
			->from('tbl_users')
			->where('username=:username', array(':username'=>Yii::app()->user->name))
			->queryRow();
							
			$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
				'id' => 'dialog',
				'options' => array(
					'title' => 'Напоминание',
					'autoOpen' => false,
					'modal' => true,
					'width' => 640,
					'height' => 480
				)
			));
		} */
	?>
	
	<?php //if (Yii::app()->user->isGuest == "0"): ?>
		<!--<div id="block">
			<?php /*
				$flag = "0";
				$res = "Fail";
				//$res = Yii::app()->gmail->getMessages($credentials["glogin"], $credentials["gpassword"]); 
				if ($res != "Fail") {
					$flag = "1";
				} */
			?>
			<input id="flag" type="hidden" value="<?php //echo $flag; ?>"/>
		</div>

		<?php //$this->endWidget('zii.widgets.jui.CJuiDialog'); ?>

		<script type="text/javascript">
			$.fn.myFunction = setInterval(function() {
				$("#block").load("index.php #block");
				
				if ($('#flag').val() == "1") {
					$('#dialog').dialog('open');
				}	
			}, 300000);
		</script> -->
	<?php //endif; ?>	
				
	<div id="footer">
		&copy; <?php echo date('Y'); ?> <a href="http://www.elcp.ru/" target="_blank">elcp.ru</a>
	</div><!-- footer -->

</div>
</body>
</html>